package com.denso.store.admin.archive;

import com.denso.store.common.model.Scheduler;
import com.jfinal.core.Controller;

import java.util.List;

/**
 * Created by lijian on 2017/10/24.
 */
public class ArchiveController extends Controller {

    static ArchiveService service = new ArchiveService();

    public void index() {
        List<Scheduler> schedulerList = service.findSchedulerListToArchive();
        setAttr("schedulerList", schedulerList);
        render("index.html");
    }

    public void archive() {
        int count = service.archive();
        setAttr("notice", "成功归档 [" + count + "] 条记录");
        index();
    }
}
